package com.xh.demo.mq.amqp.ttl;


import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;


/**
 * @author wen
 * @apiNote TtlMsgConsumer
 * @since 2021/11/11
 */
@Slf4j
@Component
public class TtlMsgConsumer {

    /**
     * 监听消息队列
     */
    @RabbitListener(queues = "user.order.receive_queue")
    public void consumeMessage(String message) {
        log.info("【消息服务-AMQP-TTL-MQ异步消息通知-接收消息】【{}】【{}】", DateUtil.format(LocalDateTime.now(), DatePattern.NORM_DATETIME_PATTERN), message);
    }

}